(Fgenerate_new_buffer_name): Return NAME argument if IGNORE argument
authorLuc Teirlinck <teirllm@auburn.edu>
Sun, 11 Apr 2004 15:40:56 +0000 (15:40 +0000)
committerLuc Teirlinck <teirllm@auburn.edu>
Sun, 11 Apr 2004 15:40:56 +0000 (15:40 +0000)
equals NAME.  Doc fix.

src/buffer.c

index 455b03efec2e1ea093c05f12b58ac75432077368..d62e186fda8105bc7edcf5147cbf45aa33fdd3b0 100644 (file)
@@ -766,7 +766,7 @@ DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name, Sgenerate_new_buff
        doc: /* Return a string that is the name of no existing buffer based on NAME.
 If there is no live buffer named NAME, then return NAME.
 Otherwise modify name by appending `<NUMBER>', incrementing NUMBER
-until an unused name is found, and then return that name.
+\(starting at 2) until an unused name is found, and then return that name.
 Optional second argument IGNORE specifies a name that is okay to use
 \(if it is in the sequence to be tried)
 even if a buffer with that name exists.  */)
@@ -779,6 +779,9 @@ even if a buffer with that name exists.  */)
 
   CHECK_STRING (name);
 
+  tem = Fstring_equal (name, ignore);
+  if (!NILP (tem))
+    return name;
   tem = Fget_buffer (name);
   if (NILP (tem))
     return name;